﻿using NUnit.Framework;
using NumSkull;

namespace NumSkullTests
{
    [TestFixture]
    public class HistogramBinValueTests
    {
        [Test]
        public void IsReferenceEqual()
        {
            var bin = new HistogramBinValue(2d);

            var isEqual = bin.Equals(bin);

            Assert.That(isEqual, Is.True);
        }

        [Test]
        public void IsNotNullEquals()
        {
            var bin = new HistogramBinValue(2d);

            var isEqual = bin.Equals(null);

            Assert.That(isEqual, Is.False);
        }

        [Test]
        public void CalculatesHashCode()
        {
            var bin = new HistogramBinValue(3d, 2);
            var other = new HistogramBinValue(2d, 3);

            Assert.That(bin.GetHashCode(), Is.Not.EqualTo(other.GetHashCode()));

        }
    }
}
